﻿#include "ApiCommand.h"
#include <QCoreApplication>
#include <iostream>
#include <QDir>

int main(int argc, char *argv[])
{
    std::wcout.imbue(std::locale("chs"));
    std::wcerr.imbue(std::locale("chs"));

    if (argc < 2)
    {
        std::wcerr << L"##ERROR##-1" << std::endl;
        std::wcerr << L"命令：ApiCommand.exe API [argv]" << std::endl;
        std::wcerr << L"  argv是API的参数列表" << std::endl;
        std::wcerr << L"  API列表如下：" << std::endl;
        std::wcerr << L"    WritePrivateProfileString" << std::endl;
        std::wcerr << L"    GetPrivateProfileString" << std::endl;
        std::wcerr << L"    RegSetValue" << std::endl;
        std::wcerr << L"    RegQueryValue" << std::endl;
        std::wcerr << L"    Sleep" << std::endl;
        std::wcerr << L"    GetProcessIdByFullName" << std::endl;
        std::wcerr << L"    GetProcessIdByPathStartWith" << std::endl;
        std::wcerr << L"    KillProcessByPID" << std::endl;
        std::wcerr << L"    KillProcessByFullName" << std::endl;
        std::wcerr << L"    KillProcessByPathStartWith" << std::endl;
        return -1;
    }

    QCoreApplication a(argc, argv);
    ApiCommand w;
    return w.execute();
}
